$('#headInp').focus(function(){
	$('#headInp').val("");
})
//淡入淡出轮播图
$(function(){
	var first = $('.mul li').eq(0).clone();
	$('.mul').append(first).width($('.mul li').length*1423);
	var len = $('.mul li').length;
	var num = 0;
		
	function move(){
		if(num > 5){
			num = 1;
			$('.mul li').eq(0).show().siblings().hide();
		}
		if(num < 0){
			num = 4;
			$('.mul li').eq(len-1).show().siblings().hide();
		}
		$('.mul li').eq(num).fadeIn(800).siblings().fadeOut(400);
		if(num > 4){
			$('.sideTab li').eq(0).addClass("sideActive").siblings().removeClass("sideActive");
		}else{
			$('.sideTab li').eq(num).addClass("sideActive").siblings().removeClass("sideActive");
		}
	}
	
	$('.prev').click(function(){
		num--;
		move();
	})
					
	$('.next').click(function(){
		num++;
		move();
	})
					
	var timer = setInterval(function(){
		num++;
		move();
	},2000)
					
	$('.banner').hover(function(){
		clearInterval(timer)
	},function(){
		timer = setInterval(function(){
			num++;
			move();
		},2000)
	})
					
	$('.sideTab li').click(function(){
		num = $(this).index();
		move();
	})
	
})


$('.tabLeft').click(function(){
	$('.tipsOne').show();
	$('.tipsTwo').hide()
})
$('.tabRight').click(function(){
	$('.tipsOne').hide();
	$('.tipsTwo').show();
})



$.ajax({
	type:"get",
	url:"file/index.json",
	async:true,
	dataType:"text",
	success:function(re){
		var jsonObj =JSON.parse(re);
		$('#comImg').prop("src",jsonObj["com"]["a"]);
		$("#comp1").text(jsonObj["com"]["b"]);
		$('#comp2').text(jsonObj["com"]["c"]);
		$('#comp3').text(jsonObj["com"]["d"]);
		
		$('#comRightImg').prop("src",jsonObj["comRight"]["a"]);
		$("#compRight1").text(jsonObj["comRight"]["b"]);
		$('#compRight2').text(jsonObj["comRight"]["c"]);
		$('#compRight3').text(jsonObj["comRight"]["d"]);
		
		$('#contButImg').prop("src",jsonObj["contButOne"]["a"]);
		$('#contButp1').text(jsonObj["contButOne"]["b"]);
		$('#contButp2').text(jsonObj["contButOne"]["c"]);
		$('#contButp3').text(jsonObj["contButOne"]["d"]);
		
		$('#contButTwoImg').prop("src",jsonObj["contButTwo"]["a"]);
		$('#contButTwop1').text(jsonObj["contButTwo"]["b"]);
		$('#contButTwop2').text(jsonObj["contButTwo"]["c"]);
		$('#contButTwop3').text(jsonObj["contButTwo"]["d"]);
		
		$('#contButThreeImg').prop("src",jsonObj["contButThree"]["a"]);
		$('#contButThreep1').text(jsonObj["contButThree"]["b"]);
		$('#contButThreep2').text(jsonObj["contButThree"]["c"]);
		$('#contButThreep3').text(jsonObj["contButThree"]["d"]);
		
		$('#contButFourImg').prop("src",jsonObj["contButFour"]["a"]);
		$('#contButFourp1').text(jsonObj["contButFour"]["b"]);
		$('#contButFourp2').text(jsonObj["contButFour"]["c"]);
		$('#contButFourp3').text(jsonObj["contButFour"]["d"]);
		
		$('#mainFirstImg').prop("src",jsonObj["mainFirstTwo"]["a"]);
		$('#mainFirstp1').text(jsonObj["mainFirstTwo"]["b"]);
		$('#mainFirstp2').text(jsonObj["mainFirstTwo"]["c"]);
		$('#mainFirstp3').text(jsonObj["mainFirstTwo"]["d"]);
		
		$('#mainFirstThreeImg').prop("src",jsonObj["mainFirstThree"]["a"]);
		$('#mainFirstThreep1').text(jsonObj["mainFirstThree"]["b"]);
		$('#mainFirstThreep2').text(jsonObj["mainFirstThree"]["c"]);
		$('#mainFirstThreep3').text(jsonObj["mainFirstThree"]["d"]);
		
		$('#mainFirstFourImg').prop("src",jsonObj["mainFirstFour"]["a"]);
		$('#mainFirstFourp1').text(jsonObj["mainFirstFour"]["b"]);
		$('#mainFirstFourp2').text(jsonObj["mainFirstFour"]["c"]);
		$('#mainFirstFourp3').text(jsonObj["mainFirstFour"]["d"]);
		
		$('#mainFirstFiveImg').prop("src",jsonObj["mainFirstFive"]["a"]);
		$('#mainFirstFivep1').text(jsonObj["mainFirstFive"]["b"]);
		$('#mainFirstFivep2').text(jsonObj["mainFirstFive"]["c"]);
		$('#mainFirstFivep3').text(jsonObj["mainFirstFive"]["d"]);
		
		$('#mainSecondImg').prop("src",jsonObj["mainSecondTwo"]["a"]);
		$('#mainSecondp1').text(jsonObj["mainSecondTwo"]["b"]);
		$('#mainSecondp2').text(jsonObj["mainSecondTwo"]["c"]);
		$('#mainSecondp3').text(jsonObj["mainSecondTwo"]["d"]);
		
		$('#mainSecondThreeImg').prop("src",jsonObj["mainSecondThree"]["a"]);
		$('#mainSecondThreep1').text(jsonObj["mainSecondThree"]["b"]);
		$('#mainSecondThreep2').text(jsonObj["mainSecondThree"]["c"]);
		$('#mainSecondThreep3').text(jsonObj["mainSecondThree"]["d"]);
		
		$('#mainSecondFourImg').prop("src",jsonObj["mainSecondFour"]["a"]);
		$('#mainSecondFourp1').text(jsonObj["mainSecondFour"]["b"]);
		$('#mainSecondFourp2').text(jsonObj["mainSecondFour"]["c"]);
		$('#mainSecondFourp3').text(jsonObj["mainSecondFour"]["d"]);
		
		$('#mainSecondFiveImg').prop("src",jsonObj["mainSecondFive"]["a"]);
		$('#mainSecondFivep1').text(jsonObj["mainSecondFive"]["b"]);
		$('#mainSecondFivep2').text(jsonObj["mainSecondFive"]["c"]);
		$('#mainSecondFivep3').text(jsonObj["mainSecondFive"]["d"]);
	}
})



$("#com").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#comRight").click(function(){
	location.href = "son.html?id="+this.id;
})


$("#contButOne").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#contButTwo").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#contButThree").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#contButFour").click(function(){
	location.href = "son.html?id="+this.id;
})


$("#mainFirstTwo").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainFirstThree").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainFirstFour").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainFirstFive").click(function(){
	location.href = "son.html?id="+this.id;
})


$("#mainSecondTwo").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainSecondThree").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainSecondFour").click(function(){
	location.href = "son.html?id="+this.id;
})
$("#mainSecondFive").click(function(){
	location.href = "son.html?id="+this.id;
})




var winScrollTop = null;
var timer = null;
window.addEventListener('scroll',function(){
	
	winScrollTop = document.body.scrollTop||window.pageYOffset||document.documentElement.scrollTop;
//	 timer = null;
	$('.fixedRightp9').click(function(){
		clearInterval(timer);
		function fn(){
			window.scrollBy(0,-100);
		}
		timer = setInterval(fn,10)
	})
	if(winScrollTop==0){
		clearInterval(timer)
	}
	if(winScrollTop>600){
		$('.fixedTop').show();
	}else{
		$('.fixedTop').hide();
	}
	if(winScrollTop>800){
		$('.fixedLeft').show();
	}else{
		$('.fixedLeft').hide();
	}
})


$('.top-a2').click(function(){
	$('.enroll').show();
})
$('.top-a1').click(function(){
	$('.register').show();
})
$('.enro').click(function(){
	$('.enroll').hide();
	$('.register').show();
})
$('.regi').click(function(){
	$('.register').hide();
	$('.enroll').show();
})
